<template>
  <div class="search">
    <f-form ref="form" :action="api.wechat" :form-key="this.formItem.weChatId" >
      <f-form-item label=""  name="weChatName" dataType="${formField.dataType}"   :value="formItem.weChatName" />
      <f-form-item label=""  name="weChatCode" dataType="${formField.dataType}"   :value="formItem.weChatCode" />
      <f-form-item label="极光短信签名"  name="jpushSmsSignId" dataType="${formField.dataType}"   :value="formItem.jpushSmsSignId" />
      <f-form-item label="24小时热线"  name="hoursHotline24" dataType="${formField.dataType}"   :value="formItem.hoursHotline24" />
      <f-form-item label="菜单栏介绍"  name="weChatMenuDesc" dataType="${formField.dataType}"   :value="formItem.weChatMenuDesc" />
      <f-form-item label="监督投诉专线"  name="servicePhone" dataType="${formField.dataType}"   :value="formItem.servicePhone" />
      <f-form-item label=""  name="appId" dataType="${formField.dataType}"   :value="formItem.appId" />
      <f-form-item label=""  name="appsecret" dataType="${formField.dataType}"   :value="formItem.appsecret" />
      <f-form-item label=""  name="aesKey" dataType="${formField.dataType}"   :value="formItem.aesKey" />
      <f-form-item label=""  name="token" dataType="${formField.dataType}"   :value="formItem.token" />
      <f-form-item label=""  name="otherAppId" dataType="${formField.dataType}"   :value="formItem.otherAppId" />
      <f-form-item label=""  name="otherAppsecret" dataType="${formField.dataType}"   :value="formItem.otherAppsecret" />
      <f-form-item label=""  name="otherToken" dataType="${formField.dataType}"   :value="formItem.otherToken" />
      <f-form-item label="微信卡券Id"  name="wxCardId" dataType="${formField.dataType}"   :value="formItem.wxCardId" />
      <f-form-item label="电话图标"  name="phoneIcon" dataType="${formField.dataType}"   :value="formItem.phoneIcon" />
      <f-form-item label="是否删除"  name="deleted" dataType="number"   :value="formItem.deleted" />
      <f-form-item label="更新人"  name="updateUser" dataType="${formField.dataType}"   :value="formItem.updateUser" />
      <f-form-item label="更新时间"  name="updateTime" dataType="${formField.dataType}"   :value="formItem.updateTime" />
      <f-form-item label="创建人"  name="createUser" dataType="${formField.dataType}"   :value="formItem.createUser" />
      <f-form-item label="创建时间"  name="createTime" dataType="${formField.dataType}"   :value="formItem.createTime" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'wechatForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          weChatId: '',
          weChatName: '',
          weChatCode: '',
          jpushSmsSignId: '',
          hoursHotline24: '',
          weChatMenuDesc: '',
          servicePhone: '',
          appId: '',
          appsecret: '',
          aesKey: '',
          token: '',
          otherAppId: '',
          otherAppsecret: '',
          otherToken: '',
          wxCardId: '',
          phoneIcon: '',
          deleted: '',
          updateUser: '',
          updateTime: '',
          createUser: '',
          createTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.weChatId) {
          let params={
              weChatId:data.weChatId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
